package com.dk.service.impl;

import com.dk.mapper.TabSellerMapper;
import com.dk.pojo.TabSeller;
import com.dk.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SellerServiceImpl implements SellerService {
    @Autowired
    private TabSellerMapper tabSellerMapper;

    @Override
    public List<TabSeller> selectInfo() {
        List<TabSeller> tabSellers = tabSellerMapper.selectByExample(null);
        return tabSellers;
    }

    @Override
    public boolean insertADD(TabSeller t) {
        int i = tabSellerMapper.insertSelective(t);
        return i > 0;
    }

    @Override
    public TabSeller selectBsid(Integer sid) {
        TabSeller tabSeller = tabSellerMapper.selectByPrimaryKey(sid);
        return tabSeller;
    }

    @Override
    public boolean updateInfo(TabSeller tabSeller) {
        int i = tabSellerMapper.updateByPrimaryKeySelective(tabSeller);

        return i < 0;
    }

    @Override
    public boolean deleteById(Integer id) {
        int i = tabSellerMapper.deleteByPrimaryKey(id);
        return i > 0;
    }

}
